package com.ldp.designpatterns.review.structure.decorator.demo2;

import com.ldp.designpatterns.review.structure.decorator.demo2.component.Battercake;
import com.ldp.designpatterns.review.structure.decorator.demo2.concreteComponent.BaseBattercake;
import com.ldp.designpatterns.review.structure.decorator.demo2.concreteDecorator.EggDecorator;
import com.ldp.designpatterns.review.structure.decorator.demo2.concreteDecorator.SausageDecorator;

/**
 * @ClassName DecoratorTest
 * @Description TODO
 * @Author lindipei
 * @Date 2023/10/20 17:32
 */
public class DecoratorTest {
    public static void main(String[] args) {
        Battercake battercake = new BaseBattercake();
        System.out.println("===来一个基础版煎饼果子==="+battercake.getMessage() + "，总价格：" + battercake.getPrice() + "元。");

        battercake = new EggDecorator(battercake);
        System.out.println("===来一个套餐A煎饼果子==="+battercake.getMessage() + "，总价格：" + battercake.getPrice() + "元。");

        battercake = new SausageDecorator(battercake);
        System.out.println("===来一个套餐A+B煎饼果子==="+battercake.getMessage() + "，总价格：" + battercake.getPrice() + "元。");

    }
}
